package COM.ZYC;

public class MystringTest {
    public static void main(String[] args) {
        String a1 = "hello java";
        String a2 = "hello java";
        if(a1.equals(a2)) {
            System.out.println("两个字符串相等");


            String noSpaceStr = a1.replaceAll(" ", "");
            System.out.println("去掉空格后为：" + noSpaceStr);

            String replacedStr = noSpaceStr.replace("java", "word");
            System.out.println("替换后为：" + replacedStr);
        } else {
            System.out.println("两个字符串不相等");
        }
    }
}
